package com.ecoolex.hotel.saas.admin.controller;

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ecoolex.hotel.saas.ws.PaymentOrderService;

@RestController
@RequestMapping("/payment/order")
public class PaymentOrderController {

	@Reference
	private PaymentOrderService paymentOrderService;
	
	@PostMapping("/notify/pay")
    public Object payNotify(@RequestBody String body) {
        return paymentOrderService.weChatPayOrderNotify(body, PaymentOrderController.class.getSimpleName());
    }

    @PostMapping("/notify/refund")
    public Object refundNotify(@RequestBody String body) {
        return paymentOrderService.weChatPayRefundNotify(body, PaymentOrderController.class.getSimpleName());
    }
}
